package com.culturesalon.dto;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.culturesalon.util.OrderState;
import com.culturesalon.util.PaymentWay;

public class Orders {
	private int id;
	private String orderId;
	private int userId;
	private Date orderTime;
	private double totalPrice;
	private OrderState orderStatus;
	private String logisticsState;
	private double deliverFee;
	private double payableFee;
	private boolean payState=false;
	private String note;
	private PaymentWay paymentWay;
	private Set<OrderItem> items=new HashSet<OrderItem>();
	private DeliverInfo deliverInfo;
	public Orders() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Orders(String orderId, int userId, Date orderTime) {
		super();
		this.orderId = orderId;
		this.userId = userId;
		this.orderTime = orderTime;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public Date getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}
	public double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}
	public OrderState getOrderStatus() {
		return orderStatus;
	}
	public void setOrderStatus(OrderState orderStatus) {
		this.orderStatus = orderStatus;
	}
	public String getLogisticsState() {
		return logisticsState;
	}
	public void setLogisticsState(String logisticsState) {
		this.logisticsState = logisticsState;
	}
	public double getDeliverFee() {
		return deliverFee;
	}
	public void setDeliverFee(double deliverFee) {
		this.deliverFee = deliverFee;
	}
	public double getPayableFee() {
		return payableFee;
	}
	public void setPayableFee(double payableFee) {
		this.payableFee = payableFee;
	}
	public boolean getPayState() {
		return payState;
	}
	public void setPayState(boolean payState) {
		this.payState = payState;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public PaymentWay getPaymentWay() {
		return paymentWay;
	}
	public void setPaymentWay(PaymentWay paymentWay) {
		this.paymentWay = paymentWay;
	}
	public Set<OrderItem> getItems() {
		return items;
	}
	public void setItems(Set<OrderItem> items) {
		this.items = items;
	}
	public DeliverInfo getDeliverInfo() {
		return deliverInfo;
	}
	public void setDeliverInfo(DeliverInfo deliverInfo) {
		this.deliverInfo = deliverInfo;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((orderId == null) ? 0 : orderId.hashCode());
		result = prime * result + userId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Orders other = (Orders) obj;
		if (orderId == null) {
			if (other.orderId != null)
				return false;
		} else if (!orderId.equals(other.orderId))
			return false;
		if (userId != other.userId)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Orders [orderId=" + orderId + ", userId=" + userId
				+ ", orderTime=" + orderTime + ", totalPrice=" + totalPrice
				+ ", orderStatus=" + orderStatus + ", logisticsState="
				+ logisticsState + ", deliverFee=" + deliverFee
				+ ", payableFee=" + payableFee + ", payState=" + payState
				+ ", note=" + note + ", paymentWay=" + paymentWay + ", items="
				+ items + ", deliverInfo=" + deliverInfo + "]";
	}

}
